package com.dalanmao.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;

public class SystemUtil {
	
	private SystemUtil() {
		throw new UnsupportedOperationException("cannot be instantiated");
	}
	
	/**
	 * 获取当前系统的SDK版本
	 * 
	 * @return
	 */
	public static String getSystemSDK() {
		return android.os.Build.VERSION.SDK;
	}

	/**
	 * 获取当前系统的AndroidId
	 * 
	 * @param mContext
	 * @return
	 */
	public static String getSystemAndroidId(Context mContext) {
		return Secure.getString(mContext.getContentResolver(), Secure.ANDROID_ID);

	}

	/**
	 * 获取当前系统的IMEI号
	 * 
	 * @param mContext
	 * @return
	 */
	public static String getSystemIMEI(Context mContext) {
		return ((TelephonyManager) mContext.getSystemService(mContext.TELEPHONY_SERVICE)).getDeviceId();
	}

	/**
	 * 获取当前系统的IMSI号
	 * 
	 * @param mContext
	 * @return
	 */
	public static String getSystemIMSI(Context mContext) {
		return ((TelephonyManager) mContext.getSystemService(mContext.TELEPHONY_SERVICE)).getSubscriberId();
	}

	/**
	 * 获取当前系统网络状态名称
	 * 
	 * @param mContext
	 * @return
	 */
	public static String getSystemNetWorkName(Context mContext) {
		ConnectivityManager connectionManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo networkInfo = connectionManager.getActiveNetworkInfo();
		return networkInfo.getTypeName();
	}

	

	/**
	 * 获取当前系统的运营商名称
	 * 
	 * @param mContext
	 * @return
	 */
	public static String getSystemModel(Context mContext) {
		return android.os.Build.MODEL;
	}

}
